<template>
  <div>
    <!-- 运维工单 -->
    <div class="search" style="height: 64px">
      <el-form :inline="true" :model="formInline">
        <el-form-item label="工单编号:">
          <el-input v-model="formInline.user" placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item label="工单状态:">
          <el-select v-model="formInline.region" placeholder="请选择">
            <el-option label="全部" value="all"></el-option>
            <el-option label="代办" value="indent"></el-option>
            <el-option label="进行" value="ing"></el-option>
            <el-option label="取消" value="cancel"></el-option>
            <el-option label="完成" value="finish"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click.native="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="result">
      <div class="operation">
        <el-button @click="dialogFormVisible = true">
          <i class="el-icon-circle-plus-outline"></i> 新建</el-button
        >
        <el-dialog title="新增工单" :visible.sync="dialogFormVisible">
          <el-form :model="form">
            <el-form-item label="设备编号：" :label-width="formLabelWidth">
              <el-input v-model="form.name" placeholder="请输入"></el-input>
            </el-form-item>
            <el-form-item label="工单类型：" :label-width="formLabelWidth">
              <el-select v-model="form.region" placeholder="请选择">
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="运维人员：" :label-width="formLabelWidth">
              <el-select v-model="form.region" placeholder="请选择">
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer" center>
            <el-button @click="dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormVisible = false"
              >确 定</el-button
            >
          </div>
        </el-dialog>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      formInline: {
        user: '',
        region: ''
      },
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      formLabelWidth: '100px',
      dialogFormVisible: true
    }
  },
  methods: {
    onSubmit () {
      console.log(this.formInline)
      // 清空表单
      // this.formInline.reset()
    }
  }
}
</script>

<style lang="scss" scoped>
.search {
  display: flex;
  height: 64px;
  width: 100%;
  -webkit-box-align: center;
  align-items: center;
  margin-bottom: 20px;
  padding-left: 17px;
  background-color: #fff;
  .el-form {
    padding-top: 20px;
  }
}
.result {
  padding: 10px;
  width: 100%;
  height: 200px;
  background-color: #fff;
  .operation {
    width: 40px;
    height: 20px;
    .el-button {
      align-items: center;
      width: 80px !important;
      height: 36px;
      padding: 0;
      color: #fff;
      font-size: 16px;
      background: linear-gradient(135deg, #ff9743, #ff5e20) !important;
    }
  }
}
</style>
